<?php
use Yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use yii\helpers\Url;
use backend\assets\AppAsset;
$this->title = '邮箱服务器设置';
?>
<div class="container">
    <div class="row">
      
        <?php echo $this->render('_leftnav') ?>
        <div class="col-md-10">
          <div class="page-header clearfix">
            <h1 class="pull-left">邮件服务器设置</h1>
            <div class="pull-right">

                                            
            </div>
          </div>

          
             <?php echo $this->render('_sitesetting') ?>

<!--	        <form id="mailer-form" class="form-horizontal" action="/index.php?r=system%2Fmailersave" method="post">-->
	        <!--站点配置表单类-->
	        <?php
	        $form = ActiveForm::begin([
		        'options' => ['class' => 'form-horizontal','id'=>'mailer-form'],
		        'action'=>Url::to(['system/emailsave']),
		        'method'=>'post',
		        'fieldConfig' => [
			        'template' => '<div class="form-group field-sconfig-host">
			        <div class="row form-group"><div class="col-md-3 control-label">{label}</div><div class="controls col-md-8 radios">{input}{error}<div class="help-block"></div><p class="help-block"></p></div></div>
		        </div>'
		        ],
	        ]);
	        ?>
<!--		        <div class="form-group field-sconfig-enabled">-->
<!--			        <div class="row form-group"><div class="col-md-3 control-label"><label class="control-label" for="sconfig-enabled">邮件发送</label></div><div class="controls col-md-8 radios"><input type="hidden" name="Sconfig[enabled]" value=""><div id="sconfig-enabled"><label><input type="radio" name="Sconfig[enabled]" value="1" checked> 开启</label>-->
<!--						        <label><input type="radio" name="Sconfig[enabled]" value="0"> 关闭</label></div><div class="help-block"></div></div></div>-->
<!--		        </div>-->

	        <?= $form->field($model, 'email_static')->radioList(['1'=>'开启','0'=>'关闭']) ?>

<!--		        <div class="form-group field-sconfig-host">-->
<!--			        <div class="row form-group"><div class="col-md-3 control-label"><label class="control-label" for="sconfig-host">SMTP服务器地址</label></div><div class="controls col-md-8 radios"><input type="text" id="sconfig-host" class="form-control" name="Sconfig[host]" value="eduadmin.myphp888.com"><div class="help-block"></div><p class="help-block">例：smtp.yourmail.com</p></div></div>-->
<!--		        </div>-->

	        <?= $form->field($model, 'smtp_service')->textInput() ?>

<!--		        <div class="form-group field-sconfig-port">-->
<!--			        <div class="row form-group"><div class="col-md-3 control-label"><label class="control-label" for="sconfig-port">SMTP端口号</label></div><div class="controls col-md-8"><input type="text" id="sconfig-port" class="form-control" name="Sconfig[port]" value="25"><div class="help-block"></div><p class="help-block">通常端口号为25</p></div></div>-->
<!--		        </div>-->

	        <?= $form->field($model, 'smtp_port')->textInput() ?>

<!--		        <div class="form-group field-sconfig-username">-->
<!--			        <div class="row form-group"><div class="col-md-3 control-label"><label class="control-label" for="sconfig-username">SMTP用户名</label></div><div class="controls col-md-8"><input type="text" id="sconfig-username" class="form-control" name="Sconfig[username]" value="user@example.com"><div class="help-block"></div><p class="help-block">正确格式应为abc@mail.com</p></div></div>-->
<!--		        </div>-->

	        <?= $form->field($model, 'smtp_username',['template'=>'<div class="form-group field-sconfig-username"><div class="row form-group"><div class="col-md-3 control-label">{label}</div><div class="controls col-md-8">{input}{error}<div class="help-block"></div><p class="help-block">正确格式应为abc@mail.com</p></div></div></div>'])->textInput() ?>

<!--		        <div class="form-group field-sconfig-password">-->
<!--			        <div class="row form-group"><div class="col-md-3 control-label"><label class="control-label" for="sconfig-password">SMTP密码</label></div><div class="controls col-md-8"><input type="text" id="sconfig-password" class="form-control" name="Sconfig[password]" value="123456"><div class="help-block"></div></div></div>-->
<!--		        </div>-->

	        <?= $form->field($model, 'smtp_password')->passwordInput() ?>

<!--		        <div class="form-group field-sconfig-from">-->
<!--			        <div class="row form-group"><div class="col-md-3 control-label"><label class="control-label" for="sconfig-from">发信人地址</label></div><div class="controls col-md-8"><input type="text" id="sconfig-from" class="form-control" name="Sconfig[from]" value="user@example.com"><div class="help-block"></div><p class="help-block">正确格式应为abc@mail.com</p></div></div>-->
<!--		        </div>-->

	        <?= $form->field($model, 'sender_address')->textInput() ?>


<!--		        <div class="form-group field-sconfig-name">-->
<!--			        <div class="row form-group"><div class="col-md-3 control-label"><label class="control-label" for="sconfig-name">发信人名称</label></div><div class="controls col-md-8"><input type="text" id="sconfig-name" class="form-control" name="Sconfig[name]" value="hanhan"><div class="help-block"></div></div></div>-->
<!--		        </div>-->

	        <?= $form->field($model, 'sender_name')->textInput() ?>

		        <div class="row form-group">
			        <div class="col-md-3 control-label"></div>
			        <div class="controls col-md-8">
				        <?= Html::submitButton('提交', ['class'=>'btn btn-primary','name' =>'submit-button']) ?>
			        </div>
		        </div>
	        <?php ActiveForm::end();?>
          </div>

          </div>
  </div>
